<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>${SYSTEM_NAME}</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/layui/css/layui.css?v=${FILE_VERSION}" media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/static/layuiadmin/style/admin.css?v=${FILE_VERSION}" media="all">
</head>
<body>
	<div class="layui-fluid">
       	<div class="layui-card">
         	<div class="layui-card-header">微信用户</div>
         	<div class="layui-card-body">
         		<div class="layui-form layer-query">
					<div class="layui-form-item">
						<div class="layui-inline">
							<label class="layui-form-label">微信编号：</label>
							<div class="layui-input-inline">
								<input type="text" id="openId" class="layui-input">
							</div>
						</div>

						<div class="layui-inline">
							<label class="layui-form-label">手机号：</label>
							<div class="layui-input-inline">
								<input type="text" id="phone" class="layui-input">
							</div>
						</div>

						<div class="layui-inline">
							<button class="layui-btn layui-btn-primary layui-border-blue" onclick="reload()">查询</button>
						</div>
					</div>
				</div>
				<hr class="layui-bg-green">
           		<table class="layui-table" lay-filter="tableList" id="layerTable">
				</table>
         	</div>
       	</div>
  	</div>

	<script src="${pageContext.request.contextPath}/static/js/common-2.0.0.js?v=${FILE_VERSION}"></script>
  	<script src="${pageContext.request.contextPath}/static/layuiadmin/layui/layui.js?v=${FILE_VERSION}"></script>
  	<script src="${pageContext.request.contextPath}/static/js/jquery-3.3.1.min.js?v=${FILE_VERSION}"></script>
	<script src="${pageContext.request.contextPath}/static/js/common/core-2.0.0.js?v=${FILE_VERSION}"></script>
  	<script>
  		var table;
	  	layui.use(['table', 'element', 'laydate'], function() {
			table = layui.table;
			table.render({ 
				elem : '#layerTable',
				even : "true",
				toolbar: '#toolbar',
				defaultToolbar: ['filter', 'exports', 'print'],
				limit: 10,
				limits: [10,30,50,100],
				id : 'tableList',
				url : getContextPath() + '/wx/user/list/listInfo',
				page : true,
				method : 'post',
				cols : [[
					// {checkbox : true,fixed : true}
					{field : 'openId',minWidth : 120,title : 'openid'}
					,{field : 'phone',width : 160,title : '手机号'}
					,{field : 'disableName',width : 120,title : '是否禁用'}
					// ,{field : 'idCard',width : 120,title : '身份证号'}
					,{field : 'nickName',width : 120,title : '微信昵称'}
					,{field : 'avatarUrl',width : 120,title : '微信头像'}
					,{field : 'genderName',width : 120,title : '性别'}
					,{field : 'province',width : 120,title : '省'}
					,{field : 'city',width : 120,title : '市'}
					,{field : 'country',width : 120,title : '县'}
					// ,{fixed: 'right', minWidth:240, align:'center',title:"操作", toolbar: '#barTpl'}
				]],
				request : {
					pageName : 'current',
					limitName : 'size'
				}
			});

			table.on('tool(tableList)', function(obj) {
				var data = obj.data;
				if (obj.event === 'del') {
					deleteById(data,obj,'/wx/user/del/deleteById');
				} else if (obj.event === 'edit') {
					addLayer('/wx/user/edit/input', data.id);
				}
			});

		});

		function reload() {
			table.reload('tableList',{
				where :{
					"openId": $("#openId").val()
					,"phone": $("#phone").val()
				}
			});
		}
  	</script>
</body>
</html>
